﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Popup.Master" CodeBehind="FreightPopup.aspx.cs"
    Inherits="VSM.FreightPopup" EnableEventValidation="false" Title="Customers"%>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        function isNumberKey(sender, evt) {
            var txt = sender.value;
            var dotcontainer = txt.split('.');
            var charCode = (evt.which) ? evt.which : event.keyCode;
            if (!(dotcontainer.length == 1 && charCode == 46) && charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            return true;
        }
    </script>
    <div>
        <asp:UpdatePanel ID="updatePanel" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:HiddenField ID="hdnDocType" runat="server" />
                <div style="height: 480px; overflow: scroll">
                    <table style="width: 100%; border: 1px;" cellpadding="3" cellspacing="0">
                        <tr>
                            <td colspan="2" style="text-align: center;">
                                <asp:GridView ID="grdFreight" runat="server" CssClass="GridInner" Width="100%" BorderColor="White"
                                    BackColor="White" AllowSorting="True" AutoGenerateColumns="False" 
                                    CellPadding="2" AllowPaging="True" PageSize="20"
                                    HeaderStyle-Height="27px" onrowdatabound="grdBP_RowDataBound">
                                    <RowStyle BackColor="#D9E0ED" ForeColor="Black" BorderColor="White" BorderWidth="2px" Height="25px" />
                                    <AlternatingRowStyle BackColor="#EEF1F7" BorderColor="White" BorderWidth="2px" Height="25px" />
                                    <Columns>
                                        <asp:TemplateField HeaderText="#">
                                            <ItemStyle HorizontalAlign="Center" Width="20px" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblNo" runat="server" Text='<%# Bind("No") %>' BorderStyle="none">
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Fees" >
                                            <ItemStyle HorizontalAlign="Center" Width="30%" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:HiddenField ID="hdnExpnsCode" Value='<%# Bind("ExpnsCode") %>' runat="server" />
                                                <asp:Label ID="lblExpnsName" runat="server" Text='<%# Bind("ExpnsName") %>' BorderStyle="none" />
                                                <asp:HiddenField ID="hdnStatus" Value='<%# Bind("Status") %>' runat="server" />
                                                <asp:HiddenField ID="hdnDocEntry" Value='<%# Bind("DocEntry") %>' runat="server" />
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Amount">
                                            <ItemStyle HorizontalAlign="Right" />
                                            <HeaderStyle VerticalAlign="Middle" Width="20%" />
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtAmount" runat="server" Style="text-align: right; width: 98%;" Text='<%# Bind("LineTotal") %>'
                                                    AutoPostBack="true" OnKeyPress="return isNumberKey(this, event);" OnTextChanged="txtAmount_OnTextChanged" />
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="Remark">
                                            <ItemStyle HorizontalAlign="left" />
                                            <HeaderStyle VerticalAlign="Middle"  Width="50%" />
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtComments" Style="text-align: left; width: 98%;" runat="server" Text='<%# Bind("Comments") %>' 
                                                    AutoPostBack="true" OnTextChanged="txtComments_OnTextChanged" >
                                                </asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                        <asp:TemplateField HeaderText="LineNum" Visible="false">
                                            <ItemStyle HorizontalAlign="left" />
                                            <HeaderStyle VerticalAlign="Middle" />
                                            <ItemTemplate>
                                                <asp:Label ID="lblLineNum" runat="server" Text='<%# Bind("LineNum") %>' >
                                                </asp:Label>
                                            </ItemTemplate>
                                        </asp:TemplateField>

                                    </Columns>
                                    <PagerStyle BackColor="#CCCCCC" HorizontalAlign="Center" Font-Bold="True" />
                                    <SelectedRowStyle Font-Bold="true" ForeColor="Red" />
                                    <HeaderStyle BackColor="#6095C9" Font-Bold="true" ForeColor="#ffffff" Font-Overline="False" Height="27px" VerticalAlign="Bottom" />
                                    <EmptyDataTemplate>
                                        <table class="GridInner" style="width: 100%; border-color: White;" border="1" rules="all" cellspacing="2" cellpadding="2">
                                            <tr valign="middle" style="height: 27px; color: white; font-weight: bold; text-decoration: none; background-color: rgb(96, 149, 201);">
                                                <th>
                                                    <span>#</span>
                                                </th>
                                                <th>
                                                    <span>Fees</span>
                                                </th>
                                                <th>
                                                    <span>Amount</span>
                                                </th>
                                                <th>
                                                    <span>Remark</span>
                                                </th>
                                            </tr>
                                            <tr>
                                                <td colspan="4">
                                                    <span>No Data</span>
                                                </td>
                                            </tr>
                                        </table>                                        
                                    </EmptyDataTemplate>
                                </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </div>
                <tr>
                    <td>
                        <asp:Button ID="btnAccept" runat="server" Text="OK" OnClick="btnAccept_Click" Style="background-image: url('/Images/bgButton.png');
                            background-repeat: no-repeat;" Width="80px" />
                    </td>
                    <td>
                        <asp:Label ID="lblError" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label>
                    </td>
                </tr>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
